<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title th:text="${'附件详情 - ' + attachment.fileName}">附件详情</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
    <div th:replace="~{fragments/header :: header}"></div>
    
    <div class="container mt-4">
        <h2>附件详情</h2>
        
        <div class="card">
            <div class="card-body">
                <h5 class="card-title" th:text="${attachment.fileName}">文件名</h5>
                <ul class="list-group list-group-flush">
                    <li class="list-group-item">
                        <strong>文件大小:</strong> 
                        <span th:text="${#numbers.formatDecimal(attachment.fileSize / 1024.0, 1, 2) + ' KB'}">文件大小</span>
                    </li>
                    <li class="list-group-item">
                        <strong>上传时间:</strong> 
                        <span th:text="${#temporals.format(attachment.uploadTime, 'yyyy-MM-dd HH:mm')}">上传时间</span>
                    </li>
                    <li class="list-group-item">
                        <strong>文件路径:</strong> 
                        <span th:text="${attachment.filePath}">文件路径</span>
                    </li>
                </ul>
                
                <div class="mt-3">
                    <a th:href="@{/freelancer/task-applications/{id}(id=${attachment.applicationId})}" class="btn btn-secondary">返回承接详情</a>
                    <a th:href="@{/freelancer/task-applications/attachment/{id}(id=${attachment.attachmentId})}" class="btn btn-primary">下载文件</a>
                </div>
            </div>
        </div>
    </div>
    
    <div th:replace="~{fragments/footer :: footer}"></div>
</body>
</html>